﻿<phone:PhoneApplicationPage 
    x:Class="Coding4Fun.Toolkit.Test.WindowsPhone.Samples.Buttons.ImageTiles"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c4f="clr-namespace:Coding4Fun.Toolkit.Controls;assembly=Coding4Fun.Toolkit.Controls"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480">
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
			<TextBlock x:Name="ApplicationTitle" Text="{StaticResource AppName}" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="image tiles" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

		<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="*" />
				</Grid.RowDefinitions>
				<c4f:ImageTile 
					x:Name="fadeTile" 
					HorizontalAlignment="Center" 
					IsFrozen="{Binding Path=IsChecked, ElementName=IsTileFrozen}" 
					AnimationType="Fade"
					AnimationDuration="250"
					ImageCycleInterval="500"
					Rows="{Binding ElementName=rows, Path=Value}"
					Columns="{Binding ElementName=cols, Path=Value}"
                    LargeTileRows="{Binding ElementName=largerows, Path=Value, Mode=TwoWay}"
					LargeTileColumns="{Binding ElementName=largecols, Path=Value, Mode=TwoWay}"
					Label="Image Tile" />
				<Grid Grid.Row="1">
					<Grid.ColumnDefinitions>
						<ColumnDefinition />
						<ColumnDefinition />
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>
						<RowDefinition Height="Auto" />
						<RowDefinition Height="Auto" />
						<RowDefinition Height="Auto" />
						<RowDefinition Height="Auto" />
					</Grid.RowDefinitions>
                    <c4f:SuperSlider 
					    Title="Rows" 
					    Name="rows"
					    Value="3" 
					    StepFrequency="1" 
					    Minimum="0"
					    Maximum="10"
                        Grid.Row="0" Grid.Column="0"/>
					<c4f:SuperSlider 
					    Title="Columns" 
					    Name="cols"
					    Value="3" 
					    StepFrequency="1" 
					    Minimum="0"
					    Maximum="10"
                        Grid.Row="0" Grid.Column="1"/>
					<c4f:SuperSlider 
					    Title="Large Tile Rows" 
					    Name="largerows"
					    Value="2" 
					    StepFrequency="1" 
					    Minimum="0"
					    Maximum="{Binding Value, ElementName=rows}" 
                        Grid.Row="1" Grid.Column="0"/>
					<c4f:SuperSlider 
					    Title="Large Tile Columns" 
					    Name="largecols"
					    Value="2" 
					    StepFrequency="1" 
					    Minimum="0"
					    Maximum="{Binding Value, ElementName=cols}" 
                        Grid.Row="1" Grid.Column="1"/>
					<c4f:SuperSlider 
					    Title="Test Dataset size" 
					    Name="data"
					    Value="15" 
					    StepFrequency="1" 
					    Minimum="0"
					    Maximum="40" 
						ValueChanged="DataValueChanged" 
                        Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2"/>
					<Grid Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="3">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="*" />
						</Grid.ColumnDefinitions>
						<!--CheckBox Name="AdBlanks" Grid.Column="0" Checked="AdBlanks_Checked">Add Blanks</CheckBox-->
						<CheckBox Name="IsTileFrozen" Grid.Column="1">Is Frozen</CheckBox>
						<Button 
							IsEnabled="{Binding ElementName=IsTileFrozen, Path=IsChecked}"
						    Click="ButtonClick"
							Grid.Column="2" 
							HorizontalAlignment="Right">
							Cycle
						</Button>
					</Grid>
				</Grid>

			</Grid>
			
		</Grid>
		<c4f:MemoryCounter />
	</Grid>
</phone:PhoneApplicationPage>
